package com.chance.cc.crawler.development.command.trigger.domain.douyin;

import com.chance.cc.crawler.development.command.trigger.CrawlerJobTriggerCommand;
import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;

import static com.chance.cc.crawler.development.command.publish.douyin.DYPublishCrawlerJob.metaServerIP;
import static com.chance.cc.crawler.development.command.publish.douyin.DYPublishCrawlerJob.metaServerPort;

/**
 * @author bx
 * @date 2020/12/7 0007 11:15
 */
public class DYCrawlerScheduleTrigger {

    private static final String domainId = "douyin";

    private static CrawlerJobTriggerCommand crawlerJobTriggerCommand =
            new CrawlerJobTriggerCommand(metaServerIP,metaServerPort);

    public static void publishDYSearchScheduleTriggerInfo(String crawlerKey,String crawlerTriggerKey){
        HttpPage page = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                crawlerTriggerKey,
                domainId,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "",
                "抖音采集任务执行");
        System.out.println("添加采集调度： "+page.getRawText());
    }
}
